if (!extension)
throw new Error('initTranslations() can only be called from extensions');
- domain = domain || extension.metadata['gettext-domain'];
+ domain ||= extension.metadata['gettext-domain'];
// Expect USER extensions to have a locale/ subfolder, otherwise assume a
// SYSTEM extension that has been installed in the same prefix as the shell
if (!extension)
throw new Error('getSettings() can only be called from extensions');
- schema = schema || extension.metadata['settings-schema'];
+ schema ||= extension.metadata['settings-schema'];
const GioSSS = Gio.SettingsSchemaSource;
function lowerBound(array, val, cmp) {
let min, max, mid, v;
- cmp = cmp || ((a, b) => a - b);
+ cmp ||= (a, b) => a - b;
if (array.length == 0)
return 0;
let changed = false;
for (const id of ids)
- changed = changed || this._events.delete(id);
+ changed ||= this._events.delete(id);
if (changed)
this.emit('changed');
let changed = false;
for (const id of this._events.keys()) {
if (id.startsWith(sourceUid))
- changed = changed || this._events.delete(id);
+ changed ||= this._events.delete(id);
}
if (changed)
let valid = true;
for (let i = 0; i < this._content.secrets.length; i++) {
let secret = this._content.secrets[i];
- valid = valid && secret.valid;
+ valid &&= secret.valid;
}
this._okButton.button.reactive = valid;
let valid = true;
for (let i = 0; i < this._content.secrets.length; i++) {
let secret = this._content.secrets[i];
- valid = valid && secret.valid;
+ valid &&= secret.valid;
if (secret.key !== null) {
if (this._settingName === 'vpn')
this._agent.add_vpn_secret(this._requestId, secret.key, secret.value);
// Filter out acknowledged notifications.
let changed = false;
this._notificationQueue = this._notificationQueue.filter(n => {
- changed = changed || n.acknowledged;
+ changed ||= n.acknowledged;
return !n.acknowledged;
});
if (!(indicator instanceof PanelMenu.Button))
throw new TypeError('Status indicator must be an instance of PanelMenu.Button');
- position = position || 0;
+ position ??= 0;
let boxes = {
left: this._leftBox,
center: this._centerBox,
for (let idx = 0; idx < choices.length; idx++) {
let button = idx;
- buttonsChanged = buttonsChanged || oldChoices[idx] !== choices[idx];
+ buttonsChanged ||= oldChoices[idx] !== choices[idx];
buttons.unshift({
label: choices[idx],
// NONE is also possible, with a connection configured to force no default route
// (but in general we should only prompt a portal if we know there is a portal)
if (GLib.getenv('GNOME_SHELL_CONNECTIVITY_TEST') != null)
- isPortal = isPortal || this._client.connectivity < NM.ConnectivityState.FULL;
+ isPortal ||= this._client.connectivity < NM.ConnectivityState.FULL;
if (!isPortal || Main.sessionMode.isGreeter)
return;